<template>
  <div id="app">
    <!-- 通过v-if销毁组件 -->
    <router-view v-if="isRouterActived" />
  </div>
</template>

<script>
export default {
  name: 'App',
  data() {
    return {
      isRouterActived: true
    }
  },
  provide() {
    return {
      reload: this.reload
    }
  },
  methods: {
    async reload() {
      this.isRouterActived = false
      await this.$nextTick
      this.isRouterActived = true
    }
  }
}
</script>
<style>

</style>
